"""
numbers = [2,4,6,8]
n = filter(lambda x: x > 3, numbers)
# n = map()
# print(n)
for i in n:
    print(i)

print(bool([]))
print(set({'a':'a1','b':'b1'})) # key

z = (1,2,3)
y = ('a','b','c')
r = zip(z,y)
print(r)

for item in r:
    print(item)

    for i in range(5):
    print(i, end=" ")  # 输出: 0 1 2 3 4

for i in range(3, 8):
    print(i, end="")  # 输出: 3 4 5 6 7

for i in range(0, 10, 2):
    print(i, end=" ")  # 输出: 0 2 4 6 8

for i in range(5, 0, -2):
    print(i, end=" ")  # 输出: 5 3 1

scores = [30,40,50,60,70,80,90]
# s = [item > 30 for item in scores]
# print(any(s > 60 for s in scores )) # True
# print(all(item > 60 for item in scores)) # False
names = ['Alice', 'Bob', 'Tom']
scores = [90, 80, 70]
print(zip(names, scores))
for name,score in zip(names, scores):
    print(name)
    print(score)

pairs = [('a', 1), ('b', 2), ('c', 3)]
letters, numbers = zip(*pairs)
print(letters)  # ('a', 'b', 'c')
print(numbers)  # (1, 2, 3)

scores = [90, 80, 70]
s1 = (s for s in scores)
print(s1)
for item in s1:
    print(item)

"""

"""
属性操作函数:
hasatter
getattr
setattr
class Student():
    def __init__(self, name, age):
        self.name = name
        self.age = age
        
s = Student('Tom', 18)
is_name = hasattr(s, 'name')
print(is_name)
name = getattr(s, 'name')
print(name)
setattr(s,'age', 19)
age = getattr(s, 'age')
print(age)

d = {'a': 'a1'}
d_key = dir(d)
print(d_key)
print('a' in d_key)

nums = (1,2,3)
strs = ('a', 'b', 'c')
strs2 = ('1', '2', '3')
# print(sum(nums))
# print(sum(strs))
# print(sum(strs2))


"""













